package com.mmm.feign.client;

import com.mmm.common.vo.SuccessVo;
import com.mmm.user.entity.Delivery;
import com.mmm.user.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @email 1067559930@qq.com
 * @author: One
 * @date: 2022/03/05
 * @time: 20:03
 */
@FeignClient("UserService")
public interface UserClient {

    @GetMapping("user/{id}")
    SuccessVo<User> selectOne(@PathVariable Long id);

    @GetMapping("/user/openId/{openId}")
    SuccessVo<User> getByOpenId(@PathVariable String openId);

    @PostMapping("/token/getClaim")
    Map<String, String> getClaim(@RequestHeader("Authorization") String authorization);

    @GetMapping("/list/{id}")
    SuccessVo<List<Delivery>> list(@PathVariable Long id);
}
